/* 
 * @Title        (����):MD5salt.java  
 * @Description  (���):
 * @author       (����):�̴��
 * @data         (ʱ��):2018��8��22�� ����8:31:28 
 * @version:  V1.0 
 */

package com.spc.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class MD5salt {

	public static Object MD5Encrtpt(String name,String pwd){//�����û�,Ϊ�û������������ֵ����
		String algorithmName="Md5";//ɢ������
		int hashIterations=1024;//���ܴ���
		ByteSource salt=ByteSource.Util.bytes(name);//��ֵ
		Object obj=new SimpleHash(algorithmName, pwd, salt, hashIterations);
		return obj;
	}
	public static void main(String[] args) {
		System.out.println(MD5salt.MD5Encrtpt("user","123").toString());
	}
}
